import java.util.Scanner;

public class test3 {
    public static boolean isNumberorChar(char s) {
        if(Character.isDigit(s) || Character.isLetter(s)){
            return true;
        }
        return false;
    }


    public StringBuilder Delete(StringBuilder str){
        StringBuilder str1 = new StringBuilder(str);
        String str2 = str.toString();
        char[] ch = str2.toCharArray();
        for (int i = ch.length - 1; i >= 0; i--) {
            if (!isNumberorChar(ch[i])) { // 假设isNumberOrChar是判断是否为字母或数字，这里取反，删除非字母数字
                str1.deleteCharAt(i);
            }
        }
        return str1;
    }

    public  boolean isPalindrome(StringBuilder s) {
        StringBuilder s1 = Delete(s);
        StringBuilder s2 = new StringBuilder(s1);
        StringBuilder s3 = s1.reverse();
        String str = s2.toString();
        String str2 = s3.toString();
        str = str.toLowerCase();
        str2 = str2.toLowerCase();
        if(str.equals(str2)){
            return true;
        }
        return false;
    }

    public static void main2(String[] args) {
        test3 test3 = new test3();
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        StringBuilder s1 = new StringBuilder(str);

        if (test3.isPalindrome(s1)){
            System.out.println(s1 + "是回文串");
        }
        else {
            System.out.println(s1 + "不是回文串");
        }
    }
}
